﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ueEngine.Biz.Inf.LogicEntity;
using ueEngine.Biz.Core.AppService.Recruitment;

namespace ueEngine.Web.WebLogic.PageDataProxy
{
    public class HomeIndex<T> : IDataProxy<HomeIndexModel>
    {
        /// <summary>
        /// 首页内容缓存，不包含任何参数
        /// </summary>
        /// <param name="keys"></param>
        /// <returns></returns>
        protected override string BuildKey(params string[] keys)
        {
            return CachePrefix + "HomeIndex";
        }

        protected override HomeIndexModel BuildRefrashAction(params string[] keys)
        {
            return new HomeIndexModel()
            {
                Durable = new RecruitService(string.Empty).QueryRecruitment(0, 10, RecruitSheetType.Durable, RecruitSheetSubject.Default),
                Newjob = new RecruitService(string.Empty).QueryRecruitment(0, 40, RecruitSheetType.Normal, RecruitSheetSubject.Default),
                Recommand = new RecruitService(string.Empty).QueryRecruitment(0, 40, RecruitSheetType.NoDefine, RecruitSheetSubject.Recommand)
            };
        }

        protected override bool CheckedParams(params string[] keys)
        {
            return true;
        }
    }
    public class HomeIndexModel
    {
        public ItemListBox<RecruitSheetModel> Durable { get; set; }
        public ItemListBox<RecruitSheetModel> Newjob { get; set; }
        public ItemListBox<RecruitSheetModel> Recommand { get; set; }
    }
}
